package com.slj.cloudaibaba.client;

import com.slj.cloudaibaba.handler.PayFeignSentinelApiFallBack;
import com.slj.cloudaibaba.model.response.PayDTO;
import com.slj.cloudaibaba.model.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "cloud-alibaba-pay", fallback = PayFeignSentinelApiFallBack.class)
public interface PayClient {
    @GetMapping("/pay/port/{id}")
    Result<String> getPort(@PathVariable Integer id);

    @GetMapping("/pay")
    Result<List<PayDTO>> findAll();

    @PostMapping("/pay")
    Result<Void> save(@RequestBody PayDTO payDTO);
}
